package com.mxf.code.controller;

import com.mxf.code.common.ResponseResult;
import com.mxf.code.pojo.entity.SysUser;
import com.mxf.code.service.LoginService;
import com.mxf.code.util.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author : [mxf]
 * @version : [v1.0]
 * @className : LoginController
 * @description : [描述说明该类的功能]
 * @createTime : [2022/9/3 20:14]
 * @updateUser : [mxf]
 * @updateTime : [2022/9/3 20:14]
 * @updateRemark : [描述说明本次修改内容]
 */
@RestController
public class LoginController {

    @Autowired
    private LoginService loginService;

    @Autowired
    private RedisUtils redisUtils;

    @PostMapping("/user/login")
    public ResponseResult<Map<String, Object>> login(@RequestBody SysUser user) {
        return loginService.login(user);
    }

    @PostMapping("/user/logout")
    public ResponseResult<Map<String, Object>> logout() {
        return loginService.logout();
    }
}
